<?php

require_once 'Zend/Gdata/App/Extension.php';

class Rass_Extension_Name extends Zend_Gdata_Extension
{
    protected $_rootElement = 'name';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }

}

class Rass_Extension_Size extends Zend_Gdata_Extension
{
    protected $_rootElement = 'size';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }

}

class Rass_Extension_Updated extends Zend_Gdata_Extension
{
    protected $_rootElement = 'updated';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }

}


class Rass_Extension_Username extends Zend_Gdata_Extension
{
    protected $_rootElement = 'username';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }
}


class Rass_Extension_FirstName extends Zend_Gdata_Extension
{
    protected $_rootElement = 'first_name';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }
}


class Rass_Extension_LastName extends Zend_Gdata_Extension
{
    protected $_rootElement = 'last_name';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }
}

class Rass_Extension_Email extends Zend_Gdata_Extension
{
    protected $_rootElement = 'email';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }
}


class Rass_Extension_Password extends Zend_Gdata_Extension
{
    protected $_rootElement = 'password';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }
}

class Rass_Extension_Mimetype extends Zend_Gdata_Extension
{
    protected $_rootElement = 'mimetype';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }
}

class Rass_Extension_XmlNamespace extends Zend_Gdata_Extension
{
    protected $_rootElement = 'xml_namespace';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }

}

class Rass_Extension_Description extends Zend_Gdata_Extension
{
    protected $_rootElement = 'description';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }

}


class Rass_Extension_Tag extends Zend_Gdata_Extension
{
    protected $_rootElement = 'tag';
    protected $_rootNamespace = 'raws';

    public function __construct($text = null)
    {
      foreach (Rass::$namespaces as $nsPrefix => $nsUri) {
          $this->registerNamespace($nsPrefix, $nsUri);
      }
      parent::__construct();
      $this->setText($text);
    }
}

class Rass_Extension_Meta extends Zend_Gdata_Extension
{
    protected $_rootElement = 'meta';
    protected $_rootNamespace = 'raws';
    protected $_vocab = null;
    protected $_meta_name = null;
    protected $_lang = null;
    protected $_attrs = array();

    public function __construct($vocab = null, $meta_name = null, $text = null, $attrs = null, $lang = null)
    {
        parent::__construct();
        $this->_vocab = $vocab;
        $this->_meta_name = $meta_name;
        $this->_lang = $lang;
        $this->setText($text);
        if ($attrs) {
          $this->_attrs = $attrs;
        }
    }

    public function getDOM($doc = NULL, $majorVersion = 1, $minorVersion = NULL)
    {
        $element = parent::getDOM($doc);
        if ($this->_vocab != null) {
            $element->setAttribute('vocab', $this->_vocab);
        }
        if ($this->_meta_name != null) {
            $element->setAttribute('meta_name', $this->_meta_name);
        }
        if ($this->_lang != null) {
            $element->setAttribute('lang', $this->_lang);
        }
        if ($this->_attrs) {
          foreach ($this->_attrs as $key => $value) {
            $element->setAttribute($key, $value);
          }
        }
        return $element;
    }

    protected function takeAttributeFromDOM($attribute)
    {
      if ($attribute->localName == "vocab") {
        $this->_vocab = $attribute->nodeValue;
      }
      elseif ($attribute->localName == "meta_name") {
        $this->_meta_name = $attribute->nodeValue;
      }
      elseif ($attribute->localName == "lang") {
        $this->_lang = $attribute->nodeValue;
      }
      else {
        $this->_attrs[$attribute->localName] = $attribute->nodeValue;
      }
        // switch ($attribute->localName) {
        // case 'vocab':
        //     $this->_vocab = $attribute->nodeValue;
        //     break;
        // case 'meta_name':
        //     $this->_meta_name = $attribute->nodeValue;
        //     break;
        // case 'wakka':
        //     $this->_wakka = $attribute->nodeValue;
        //     break;
        // default:
        //     parent::takeAttributeFromDOM($attribute);
        // }
    }

    public function getVocab()
    {
        return $this->_vocab;
    }
    
    public function setVocab($value)
    {
        $this->_vocab = $value;
        return $this;
    }
    
    public function getMetaName()
    {
        return $this->_meta_name;
    }
    
    public function setMetaName($value)
    {
        $this->_meta_name = $value;
        return $this;
    }

    public function getLang()
    {
        return $this->_lang;
    }
    
    public function setLang($value)
    {
        $this->_lang = $value;
        return $this;
    }

}
